{% include "../public/min-header.html" %}
<div class="wrapper">
    {% include "../public/breadcrumb.html" %}
    <section class="content">
    <!--<div class="container-fluid">-->
    <div class="row">
      <div class="col-sm-12">
        <div class="panel panel-default">
        	<div class="pull-right">
            		<a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel-heading">
                <h3 class="panel-title">
                	<i class="fa fa-list"></i> 二维码生成
                </h3>
            </div>
            <div class="panel-body">
                <form id="submitForm" method="post">
                    <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <td class="col-sm-2">
                            文本内容：
                        </td>
                        <td class="col-sm-8">
                            <input type="text" placeholder="请输入生成二维码的内容" class="form-control qrcode_text">
                            <img class="show_img hidden" src="" width="200" height="200">
                        </td>
                        
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <button type="button" class="btn btn-info qrcode"  data-post-url="{{helper.pathFor('adtlqr')}}" >
                                <i class="ace-icon fa fa-check bigger-110"></i> 生成
                            </button>
                        </td>
                    </tr>
                    </tbody>
                </table>
                </form>
            </div>
        </div>
 	  </div> 
    </div>    <!-- /.content -->
   </section>
</div>

<script>
    $(function(){
        $('.qrcode').on('click', function() {
            const text = $('.qrcode_text').val();
            const _csrf = $(this).attr('data-csrf');
            const url = $(this).attr('data-post-url');
            if (!text) {
                return layer.msg('请输入要生成二维码的内容！');
            }
            const data = {};
            data.text = text;
            const img_url = url + '?' + $.param(data);
            $('.show_img').attr('src',img_url);
            $('.show_img').removeClass('hidden');
        });
    });
</script>

{% include "../public/main-footer.html" %}